import book.BookList;
import user.AdimiUser;
import user.NomalUser;
import user.User;

import java.util.Scanner;

/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2021-09-16
 * Time:11:23
 */
public class Main {
    public static User login(){
        System.out.println("请输入姓名：");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.next();
        System.out.println("请输入你的身份： 1.管理员  0.普通用户");
        int choice = scanner.nextInt();
        if(choice == 1){
            return new AdimiUser(name);
        }else {
           return new NomalUser(name);
        }
    }
    public static void main(String[] args) {
        BookList bookList = new BookList();
        //结合所有的东西都串到一起
              User user = login();

             while (true) {
                 int choice;
                 choice = user.menu();
//                 System.out.println(choice);
                 user.doOpearation(choice, bookList);
             }
        //如何将选择对应上
    }
}
